<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="util" uri="/WEB-INF/kdd-util.tld" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<sec:authorize access="isAuthenticated()">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>
            <jsp:include page="../../menu.jsp" />
            <jsp:include page="../menu.jsp" />
            <h6><spring:message code="msg.adduser" /></h6>
            <c:url var="action" value="/admin/user/add" />
            <form:form class="well notfull form-horizontal" action="${action}" method="POST" modelAttribute="addUserBean">
                <fieldset>
                    <div class="control-group">
                        <label class="control-label"><spring:message code="msg.username" />:</label>
                        <div class="controls">
                            <form:input class="input-xlarge" path="username" /><br />
                            <form:errors path="username" cssClass="label label-important" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"><spring:message code="msg.password" />:</label>
                        <div class="controls">
                            <form:password class="input-xlarge" path="password" /><br />
                            <form:errors cssClass="label label-important" path="password" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"><spring:message code="msg.repassword" />:</label>
                        <div class="controls">
                            <form:password class="input-xlarge" path="rePassword" /><br />
                            <form:errors cssClass="label label-important" path="rePassword" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"><spring:message code="msg.userlevel" />:</label>
                        <div class="controls">
                            <form:select class="authmulti" path="authorities" multiple="true" items="${authList}" itemValue="authority" itemLabel="authority" />
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary"><spring:message code="msg.save" /></button>
                        <button type="reset" class="btn btn-warning"><spring:message code="msg.reset" /></button>
                    </div>
                </fieldset>
            </form:form>
            <script type="text/javascript">
                $(".authmulti").chosen();
            </script>
            <jsp:include page="../../foot.jsp" />
        </sec:authorize>